package com.itqf.servie;

import com.itqf.execption.UserLoginExecption;
import com.itqf.pojo.User;

/**
 * projectName: springmvcgp8
 *
 * @author: 赵伟风
 * time: 2021/8/6 16:35
 * description:
 */
public class ExecuptionUserService {

    public User login(String username, String password) throws UserLoginExecption {



        if (username == null || password == null){


            throw new UserLoginExecption("账号或者密码为null");
        }

        if(username != "root"){

            throw new UserLoginExecption("账号错误");
        }

        if (password != "123")
        {
            throw new UserLoginExecption("密码错误");
        }

        User user = new User();
        user.setUsername(username);
        user.setPassword(password);
        user.setSex("男");


        return user;
    }

}
